home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWFiles / Include / SLFileAc.xh < prev    next >
Encoding:
Text File  |  1996-08-16  |  4.2 KB  |  193 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLFileAc.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *     File:                SLFileAc.idl
  14.  *     Release Version:    $ ODF 1 $
  15.  * 
  16.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  17.  * 
  18.  * 
  19.  */
  20.  
  21.  
  22. #ifndef SOM_FW_OFileSink_xh
  23. #define SOM_FW_OFileSink_xh
  24.  
  25. class FW_OFileSink;
  26.  
  27. #define FW_OFileSink_MajorVersion 1
  28. #define FW_OFileSink_MinorVersion 0
  29.  
  30. /*
  31.  * Passthru lines: File: "C.xh", "before"
  32.  */
  33.  
  34.  
  35. /* C++ SOM defs */
  36. #include <somcls.xh>
  37. #include <somcm.xh>
  38.  
  39. /* C++ parent defs */
  40. #ifndef SOM_FW_ORandomAccessSink_xh
  41. #include <SLRanSin.xh>
  42. #endif
  43.  
  44. #ifndef FW_OFileSink_API
  45. #define FW_OFileSink_API
  46. /*
  47.  * -- The Class API
  48.  */
  49.  
  50. /*
  51.  * Start of user-defined types:
  52.  */
  53. class SOMClass;
  54. class SOMObject;
  55. class FW_OSink;
  56. class FW_ORandomAccessSink;
  57. class FW_ORefCount;
  58. class FW_OFileSpecification;
  59. class FW_ODirectorySpecification;
  60. class FW_OFile;
  61. class FW_OFileSink;
  62.  
  63. /*
  64.  * End of user-defined types.
  65.  */
  66.  
  67. #ifdef OLDIBMSOMAPISUPPORT
  68. #define FW_OFileSinkCClassData FW_OFileSinkClassData
  69. #define FW_OFileSinkNewClass(major,minor) somNewVersionedClassReference(FW_OFileSink,major,minor)
  70. #endif
  71.  
  72. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  73. #define FW_OFileSinkMetaClass SOMClass
  74.  
  75. #if PRAGMA_ALIGN_SUPPORTED
  76. #  pragma options align=power
  77. #endif
  78.  
  79. /* The API to the FW_OFileSink class object, and the methods it introduces. */
  80. SOMEXTERN struct FW_OFileSinkClassDataStructure {
  81. #ifdef OLDIBMSOMAPISUPPORT
  82.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  83. #else
  84.     long zero;
  85. #endif
  86.     somStaticClassInfo *sci;
  87.     somDToken        instanceDataToken;
  88.     long reserved [3];
  89.     somMToken InitFromOFile;
  90.     somMToken GetOFileRep;
  91. } SOMDLINK FW_OFileSinkClassData;
  92.  
  93. #if PRAGMA_ALIGN_SUPPORTED
  94. #  pragma options align=reset
  95. #endif
  96.  
  97. #if !defined(FW_OFileSink_Class_Source) && !defined(SOM_Module_slfileac_Source)
  98. #if PRAGMA_IMPORT_SUPPORTED
  99. #pragma import list FW_OFileSinkClassData
  100. #endif
  101. #endif
  102.  
  103.  
  104. /*
  105.  * -- Typedefs and inline method declarations for left path inherited methods
  106.  * -- are omitted because this compilation had -museinheritedmethods in effect
  107.  */
  108.  
  109.  
  110. /*
  111.  * -- Typedefs for FW_OFileSink Method Procedures
  112.  */
  113. SOMEXTERN {
  114. typedef void   (* SOMLINK somTD_FW_OFileSink_InitFromOFile)(FW_OFileSink *somSelf, Environment *ev,
  115.         FW_OFile* theFile);
  116. typedef FW_OFile*   (* SOMLINK somTD_FW_OFileSink_GetOFileRep)(FW_OFileSink *somSelf, Environment *ev);
  117. }
  118.  
  119. #endif /* FW_OFileSink_API */
  120.  
  121.  
  122. /*
  123.  * -- This emitter treats Method Tokens as Thunks by default.
  124.  * -- Use the sc modifier "nothunks" to change this default
  125.  */
  126. #undef somresolve_
  127. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  128.  
  129. /*
  130.  * -- The C++ Wrapper Class for FW_OFileSink
  131.  */
  132. class FW_OFileSink : public FW_ORandomAccessSink
  133. {
  134. public:
  135.  
  136. // FW_OFileSink::new registers use of the class object, and then uses somNew
  137. // to allocate memory and load the object method table pointer. 
  138. void *operator new(size_t size)
  139. {
  140.     SOM_IgnoreWarning(size);
  141.     // Allocate memory using the default allocator for FW_OFileSink, and
  142.     // clear mem & set method table pointer, call basic initialization
  143. #ifdef SOMCHKNULL
  144.     void * __somResult = (void *)
  145.       somNewObject(FW_OFileSink);
  146.     SOMCHKNULL(__somResult);
  147.     return __somResult;
  148. #else
  149.     return (void*) somNewObject(FW_OFileSink);
  150. #endif
  151. }
  152.  
  153. // FW_OFileSink::delete uses the default deallocator for the object's class.
  154. void operator delete(void * obj)
  155. {
  156.     if (obj) {
  157.         SOM_Resolve(obj,SOMObject,somFree)
  158.            ( (SOMObject*) obj );
  159.     }
  160. }
  161.  
  162. /* method: InitFromOFile */
  163. void   InitFromOFile(Environment *ev,
  164.         FW_OFile* theFile)
  165. {
  166.    SOM_ResolveD(this,FW_OFileSink,FW_OFileSink,InitFromOFile)
  167.     (this,ev,theFile);
  168. #ifdef SOMCHKEXCEPT
  169.       SOMCHKEXCEPT;
  170. #endif
  171. }
  172.  
  173. /* method: GetOFileRep */
  174. FW_OFile*   GetOFileRep(Environment *ev)
  175. {
  176.    #ifdef SOMCHKEXCEPT
  177.    FW_OFile* __somResult = 
  178.       SOM_ResolveD(this,FW_OFileSink,FW_OFileSink,GetOFileRep)
  179.     (this,ev);
  180.       SOMCHKEXCEPT;
  181.    return __somResult;
  182. #else
  183.    return SOM_ResolveD(this,FW_OFileSink,FW_OFileSink,GetOFileRep)
  184.     (this,ev);
  185. #endif
  186. }
  187.  
  188. };   /* FW_OFileSink */
  189.  
  190.  
  191.  
  192. #endif       /* SOM_FW_OFileSink_xh */
  193.